package Util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Administrator on 2017/12/18.
 */
public class ActionContext {

    private  static final ThreadLocal<ActionContext> actionContextThreadLocal = new ThreadLocal<ActionContext>();

    private HttpServletRequest request;
    private HttpServletResponse response;

    private ActionContext(){

    }
    public  static  ActionContext getContext(){
       if(actionContextThreadLocal.get() == null){
           ActionContext context = new ActionContext();
           actionContextThreadLocal.set(context);
       }
        return  actionContextThreadLocal.get();
    }
    public HttpServletRequest getRequest() {
        return request;
    }
    public void setRequest(HttpServletRequest request) {
        this.request = request;
    }

    public HttpServletResponse getResponse() {
        return response;
    }

    public void setResponse(HttpServletResponse response) {
        this.response = response;
    }
}
